# 使用迭代的思路返回list的最大值和最小值


def findMinAndMax(L):   
    if len(L) == 0:
        return (None, None)
    else:
        max = L[0]
        min = L[0]
        for i in L:
            if i < min:
                min = i
            if i > max:
                max = i
    return (min, max)